home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / standard / sqrt.z / sqrt
Encoding:
Text File  |  2002-10-03  |  4.5 KB  |  89 lines

  1. SQRT(3M)                                               Last changed: 2-2-99
  2.  
  3.  
  4. NNAAMMEE
  5.      ssqqrrtt, ffssqqrrtt, ssqqrrttff, ssqqrrttll, ccbbrrtt, ccbbrrttll - cube root, square root
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<mmaatthh..hh>>
  9.  
  10.      ddoouubbllee ssqqrrtt((ddoouubbllee _x));;
  11.      ffllooaatt ffssqqrrtt((ffllooaatt _x));;
  12.      ffllooaatt ssqqrrttff((ffllooaatt _x));;
  13.      lloonngg ddoouubbllee ssqqrrttll((lloonngg ddoouubbllee _x));;
  14.  
  15.      ddoouubbllee ccbbrrtt((ddoouubbllee _x));;
  16.      lloonngg ddoouubbllee ccbbrrttll((lloonngg ddoouubbllee _x));;
  17.  
  18. IIMMPPLLEEMMEENNTTAATTIIOONN
  19.      IRIX systems
  20.  
  21. DDEESSCCRRIIPPTTIIOONN
  22.      The single-precision and long double-precision routines listed above
  23.      are only available in the standard math library, --llmm, and in --llmmxx.
  24.  
  25.      The ssqqrrtt functions return the nonnegative square root of their single
  26.      argument _x. The function ssqqrrtt both accepts and returns values of type
  27.      double.  The functions ffssqqrrtt and ssqqrrttff accept and return float values.
  28.      The function ssqqrrttll both accepts and returns values of type long
  29.      double.
  30.  
  31.      A fast version of ssqqrrtt and ffssqqrrtt which are slightly less accurate are
  32.      available in the library --llffaassttmm. On MIPS2 and newer processors, those
  33.      routines are identical to the ones in lliibbmm..aa, because there are
  34.      hardware square root instructions.
  35.  
  36.      The ccbbrrtt functions return the cube root of their single argument _x.
  37.      The function ccbbrrtt both accepts and returns values of type double.  The
  38.      function ccbbrrttll both accepts and returns values of type long double.
  39.  
  40. RREETTUURRNN VVAALLUUEESS
  41.      Functions in the standard math library lliibbmm..aa, are referred to as --llmm
  42.      versions. Those in math library lliibbmmxx..aa are referred to as --llmmxx
  43.      versions. Those in the the BSD math library lliibbmm4433..aa are referred to
  44.      as --llmm4433 versions. The --llmm and --llmmxx versions always return the default
  45.      Quiet NaN and set eerrrrnnoo to EDOM when a NaN is used as an argument.  A
  46.      NaN argument usually causes the --llmm4433 versions to return the same
  47.      argument.  The --llmm4433 versions never set eerrrrnnoo.
  48.  
  49.      If _x is negative, the ssqqrrtt functions return a quiet NaN. The --llmm and
  50.      --llmm4433 versions also set the flag in the floating-point coprocessor to
  51.      indicate an invalid operation.  The functions in the standard math
  52.      library --llmm and in library --llmmxx also set eerrrrnnoo to EDOM.
  53.  
  54.      See mmaatthheerrrr(3M) for a description of error handling for --llmmxx
  55.      functions.
  56.  
  57. NNOOTTEESS
  58.      Long double operations on this system are only supported in _r_o_u_n_d-_t_o-
  59.      _n_e_a_r_e_s_t rounding mode (the default).  The system must be in round-to-
  60.      nearest rounding mode when calling any of the long double functions,
  61.      or incorrect answers result.
  62.  
  63.      Users concerned with portability to other computer systems should note
  64.      that the long double and float versions of these functions are
  65.      optional according to the ANSI C Programming Language Specification
  66.      ISO/IEC 9899 : 1990 (E).
  67.  
  68.      Long double functions have been renamed to be compliant with the
  69.      ANSI-C standard, however to be backward compatible, they may still be
  70.      called with the double precision function name prefixed with a qq.
  71.  
  72.      Code which calls ssqqrrtt(()) or ssqqrrttff(()) will be compiled into the machine
  73.      instruction ssqqrrtt..dd or ssqqrrtt..ss if the code uses ##iinncclluuddeess <<mmaatthh..hh>>.
  74.  
  75.    EErrrroorrss
  76.      ccbbrrtt is accurate to within 0.7 ULPs (a ULP if one _Unit in _Last _Place).
  77.  
  78.      lliibbmm..aa ssqqrrtt conforms to IEEE 754 and is correctly rounded in
  79.      accordance with the rounding mode in force; the error is less than
  80.      half a ULP in the default mode (round to nearest).
  81.  
  82.      The lliibbffaassttmm..aa ssqqrrtt and ffssqqrrtt error is a maximum of one ULP.  (See
  83.      however, the comments regarding --llffaassttmm above.)
  84.  
  85. SSEEEE AALLSSOO
  86.      mmaatthh(3M)
  87.  
  88.      This man page is available only online.
  89.